//package com.wisdudu.ehome.ui.common;
//
//import com.kelin.mvvmlight.base.ViewModel;
//import com.kelin.mvvmlight.command.ReplyCommand;
//
///**
// * Created by ypp on 2016/8/29.
// */
//public class SelectImageVM implements ViewModel {
//    private static final String TAG = "SelectImageVM";
//    private final int REQUEST_CODE_CAMERA = 1000;
//    private final int REQUEST_CODE_GALLERY = 1001;
//    private int maxImgNum;
//    private SelectImageFragment selectImageFragment;
//
//    public SelectImageVM(SelectImageFragment selectImageFragment, int max_img_num) {
//        this.selectImageFragment = selectImageFragment;
//        maxImgNum = max_img_num;
//    }
//
//    public ReplyCommand onAlbumClick = new ReplyCommand(() -> {
////        GalleryFinal.openGalleryMuti(REQUEST_CODE_GALLERY, maxImgNum, mOnHanlderResultCallback);
//    });
//    public ReplyCommand onCareamClick = new ReplyCommand(() -> {
////        GalleryFinal.openCamera(REQUEST_CODE_CAMERA, mOnHanlderResultCallback);
//    });
//    public ReplyCommand onSysClick = new ReplyCommand(() -> {
//        selectImageFragment.addFragment(new SelectSystemImgFragment());
//    });
//
////    private GalleryFinal.OnHanlderResultCallback mOnHanlderResultCallback = new GalleryFinal.OnHanlderResultCallback() {
////        @Override
////        public void onHanlderSuccess(int reqeustCode, List<PhotoInfo> resultList) {
////            switch (reqeustCode) {
////                case REQUEST_CODE_GALLERY:
////                case REQUEST_CODE_CAMERA:
////                    if (resultList != null) {
////                        ToastUtil.INSTANCE.toast("照片选择成功：");
////                        ArrayList<String> selectedPahts = new ArrayList<>();
////                        for (int i = 0; i < resultList.size(); i++) {
////                            Log.i(TAG, "onHanlderSuccess: 选择图片结果" + resultList.get(i).getPhotoPath());
////                            String absolutePath = ImageHelper.scal(resultList.get(i).getPhotoPath()).getAbsolutePath();
////                            selectedPahts.add(absolutePath);
////                        }
////                        Intent intent = new Intent();
////                        intent.putStringArrayListExtra(RxBusFlag.SELECT_IMGS, selectedPahts);
////                        getActivity().setResult(Activity.RESULT_OK, intent);
////                        getActivity().finish();
////                    }
////                    break;
////                default:
////                    break;
////            }
////
////        }
////
////        @Override
////        public void onHanlderFailure(int requestCode, String errorMsg) {
////            ToastUtil.INSTANCE.toast(errorMsg);
////        }
////    };
//
//}
